package com.shyroke.daydayzhuanapi.dto;

import com.shyroke.daydayzhuanapi.entity.LabelEntity;
import com.shyroke.daydayzhuanapi.entity.TypeEntity;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class TypeDto  implements Serializable {

    private Integer id;
    private String typeName;
    private Integer parentId;
    private String href;
    private String keys;
    private String labelIds;

    private List<TypeDto> typeList = new ArrayList<>();
    private List<LabelEntity> labelList;

    private boolean isSelected = false;


    public int compareTo(TypeDto key) {
        if(this.getId() < key.getId()){
            return -1;
        }else{
            return 1;
        }
    }
}